package rulebase;

import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JScrollPane;


public class FormSelectionPanel extends JPanel
{
	private JList FSFeatureList;
	private JComboBox cbxFSBaseForm;
	
	public FormSelectionPanel()
	{
		setLayout(null);
		initGUI();
	}
	
	private void initGUI()
	{
		FSFeatureList = new JList();

		JLabel lblFSBaseForm = new JLabel("Base Form");
		lblFSBaseForm.setBounds(10, 11, 80, 14);
		add(lblFSBaseForm);
		
		JLabel lblFSFeatures = new JLabel("Features");
		lblFSFeatures.setBounds(10, 54, 80, 14);
		add(lblFSFeatures);
		
		cbxFSBaseForm = new JComboBox();
		cbxFSBaseForm.setBounds(100, 8, 150, 20);
		add(cbxFSBaseForm);
		
		JScrollPane spFSFeatures = new JScrollPane();
		spFSFeatures.setBounds(10, 79, 424, 331);
		add(spFSFeatures);
		spFSFeatures.setViewportView(FSFeatureList);
		
		initCbxFSBaseFormItems();
	}
	
	private void initCbxFSBaseFormItems()
	{
		DefaultComboBoxModel model = new DefaultComboBoxModel();
		model.addElement("Stem");
		cbxFSBaseForm.setModel(model);
		
	}

	public void setSimpleFeaturesListModel(DefaultListModel model){
		FSFeatureList.setModel(model);
	}
	
	public String getCbxFSBaseFormText()
	{
		return (String) cbxFSBaseForm.getSelectedItem();
	}
	
	public void getCbxFSBaseFormText(String s)
	{
		cbxFSBaseForm.setSelectedItem(s);
	}
	
}
